<?php
namespace app\index\validate;
use think\facade\Db;
use think\Validate;

class Goods extends Validate
{

    protected $rule=[
        'goods_name'    =>'require',
        'specs'    =>'require',
        'price'    =>'require',
        'goods_id'    =>'require',
    ];
    protected $message = [
        'goods_name.require'    => '请输入商品名称',
        'specs.require'    => '请输入商品规格',
        'price.require'    => '请输入商品价格',
        'goods_id.require'    => '缺少关系参数',
    ];
    protected $scene = [
        'add' =>['goods_type_id','price'],
        'edit'=>['goods_type_id','price','goods_id'],
        'del' =>['goods_id'],
    ];

}